@extends('admin::layouts.master')
@section('content')
    <form action="/admin/adminuser/assignRole/{{$admin['id']}}" method="POST">
        @csrf
        <div class="x_panel">
            <div class="x_title">
                <h2>正在为[<span style="color:red;"> {{$admin['nickname']}} </span>] 分配角色</h2>
                <div class="clearfix"></div>
            </div>
                <div class="form-group">
                    <div class="col-md-9 col-sm-9 col-xs-12">
                            <div class="checkbox">
                                <p class="lead"></p>
                                @foreach($roles as $role )
                                    <label class="inline">
                                        <input name="name[]" type="checkbox" {{$admin->hasRole($role['name']) ? 'checked=""' : ''}}  value="{{$role['name']}}" class="flat"> {{$role['title']}}
                                    </label>
                                @endforeach
                            </div>
                    </div>
                </div>
        </div>
        <button class="btn btn-primary">提交</button>
    </form>
@endsection
